package com.shujia.core

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.rdd.RDD

object Code23Action3 {
  def main(args: Array[String]): Unit = {
    val sc = new SparkContext(new SparkConf().setMaster("local").setAppName("CoGroup"))

    val value1RDD: RDD[(String, Int)] = sc.parallelize(List(("k1", 11), ("k1", 1), ("k2", 2), ("k3", 3), ("k5", 5), ("k4", 4), ("k3", 3), ("k3", 33)), 2)

    val scalaArr: Array[(String, Int)] = value1RDD
      .collect()
    println(scalaArr.toList)

  }
}
